<template>
  <div>
    <div>ChildOne</div>
    <div @click="changeCount">{{ count }}</div>
    <div @click="onChangeMsg">parent:{{msg}}</div>
  </div>
</template>

<script>
import { ref, inject } from "vue";
export default {
  
  setup() {
    const count = ref(0);
    const changeCount = () => {
      count.value++;
    };
    const {msg}= inject('parentMsg')
    const onChangeMsg = inject('onChangeMsg')
    return {
      count,
      changeCount,
      msg,
      onChangeMsg
    };
  },
};
</script>

<style>
</style>